Skip to content

microbenchmarks: extend all to additional low-precision dtypes, restructure GEMM - #714

Open
matthiasdiener wants to merge 2 commits into
devfrom
mdiener/microbench-dtypes
Open

microbenchmarks: extend all to additional low-precision dtypes, restructure GEMM#714
matthiasdiener wants to merge 2 commits into
devfrom
mdiener/microbench-dtypes

Conversation

@matthiasdiener

@matthiasdiener matthiasdiener commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

  • add MXFP8/MXFP4/NVFP4 support
  • unify dense GEMM benchmark files

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@matthiasdiener matthiasdiener self-assigned this Aug 24, 2026
@matthiasdiener
matthiasdiener marked this pull request as ready for review August 25, 2026 15:18
@matthiasdiener
matthiasdiener requested review from Micky774 and alextmagro and a balanced review from Copilot August 25, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Consolidates microbenchmarks around shared precision recipes and expands low-precision coverage.

Changes:

  • Adds shared BF16, FP8, MXFP8, MXFP4, and NVFP4 recipe selection.
  • Extends GEMM, grouped GEMM, casting, and normalization benchmarks.
  • Merges the standalone FP8 GEMM benchmark into the dense GEMM benchmark.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
benchmarks/microbenchmarks/utils.py Adds shared recipe construction and support checks.
benchmarks/microbenchmarks/README.md Documents expanded precision coverage.
benchmarks/microbenchmarks/benchmark_normalization.py Adds quantized-output forward benchmarks.
benchmarks/microbenchmarks/benchmark_grouped_gemm.py Adds low-precision grouped GEMM sweeps.
benchmarks/microbenchmarks/benchmark_gemm.py Adds unified precision sweeps.
benchmarks/microbenchmarks/benchmark_gemm_fp8.py Removes the superseded standalone FP8 benchmark.
benchmarks/microbenchmarks/benchmark_casting.py Adds MXFP8, NVFP4, and MXFP4 casting cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +49 to +57
# Forward output bytes/elem by precision (input is always bf16 = 2 bytes/elem):
# bf16 : 2.0
# fp8 : 1.0 (E4M3/E5M2 data, per-tensor scale ~ 0)
# mxfp8 : 1.0 + 1/32 (+ E8M0 1 byte / 32-elem block)
_FWD_WRITE_BYTES = {
"bf16": 2.0,
"fp8": 1.0,
"mxfp8": 1.0 + 1.0 / 32,
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 89ecd42

te.autocast. Precisions whose hardware/runtime support is unavailable on the
current device are skipped automatically.

Note: Transformer Engine exposes no MXFP6 recipe (MXFP6 exists only as a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably don't need to mention MXFP6 here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 89ecd42

@matthiasdiener matthiasdiener changed the title microbenchmarks: restructure, extend to additional low-precision dtypes microbenchmarks: restructure GEMM, extend all to additional low-precision dtypes Aug 25, 2026
@matthiasdiener matthiasdiener changed the title microbenchmarks: restructure GEMM, extend all to additional low-precision dtypes microbenchmarks: extend all to additional low-precision dtypes, restructure GEMM Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants